﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CdcSoftware.Pivotal.Engine.Client.ClientTasks.Attributes;
using CdcSoftware.Pivotal.Applications.Core.Client;
using System.Data;
using CdcSoftware.Pivotal.Engine.Client.Services.Interfaces;
using System.Windows.Forms;
using CdcSoftware.Pivotal.Engine;
using CdcSoftware.Pivotal.Applications.Core.Common;

namespace Pcm.Retail.Client.FormTasks.CommandHandlers
{
    public class RE_Inventory_TransferCommandHandlers : CommandClientTask
    {        
        //[ClientTaskCommand]
        //public virtual void NewGRTempCommand()
        //{
        //    try
        //    {
        //        //RA:16/Aug/2012:Change for Mobile System:Start:
        //        if (!this.SystemClient.SystemInformation.IsMobile)
        //        {
        //            PivotalMessageBox.Show("This feature is only available for offline users.", MessageBoxButtons.OK, MessageBoxIcon.Stop);
        //            return;
        //        }
        //        Globals.NewForm("RE_New_Goods_Receive(Temp)", null);
        //        //RA:16/Aug/2012:Change for Mobile System:End:
        //    }
        //    catch (Exception exc)
        //    {
        //        Globals.HandleException(exc);
        //    }
        //}

        [ClientTaskCommand]
        public virtual void NewGICommand()
        {
            try
            {
                if (SystemClient.SystemInformation.IsMobile && !Pcm.Retail.Client.Globals.IsMasterPOS)
                {
                    PivotalMessageBox.Show("This feature is not available Offline when POS is not Master POS.", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }
                Globals.NewForm("RE_Goods_Issue", null);
            }
            catch (Exception exc)
            {
                Globals.HandleException(exc);
            }
        }

        [ClientTaskCommand]
        public virtual void NewRMACommand()
        {
            try
            {
                if (SystemClient.SystemInformation.IsMobile && !Pcm.Retail.Client.Globals.IsMasterPOS)
                {
                    PivotalMessageBox.Show("This feature is not available Offline when POS is not Master POS.", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }
                Globals.NewForm("RE_RMA", null);
            }
            catch (Exception exc)
            {
                Globals.HandleException(exc);
            }
        }
    }
}
